package com.blb.mvc.controller;

import com.blb.mvc.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

/**
 * 学生控制器
 */
@Controller
public class StudentController {

    @RequestMapping("/toStudent")
    public String toStudent(){
        return "student";
    }

    @RequestMapping(value = "addStudent",method = RequestMethod.POST)
    public String addStudent(
            @RequestParam("student") Student student,
            @RequestParam("time") LocalDateTime time){
        System.out.println(student);
        System.out.println(time);
        return "student";
    }
}
